<template>
    <el-container class="boxmain">
        <el-header>
            <Head :userinfo="userinfo"/>
        </el-header>
        <el-container  class="submain">
            <el-aside width="200px">  <Menu :userinfo="userinfo"/> </el-aside>
            <el-container>
                <el-main>
                    <router-view></router-view>
                </el-main>
                <el-footer>
                    <Foot/>
                </el-footer>
            </el-container>
        </el-container>
    </el-container>
</template>

<script>
import Head from "@/components/head.vue"
import Foot from "@/components/foot.vue"
import Menu from "@/components/sidemenu.vue"
import {getuserinfo} from "@/api"


export default {
    components:{
        Head,
        Foot,
        Menu,
        path:this.$route.path
    },
    data(){
        return {
            userinfo:null
        }
    },
    mounted(){
        getuserinfo()
        .then(res=>{
            console.log(res)
            console.log(res.result)
            if(res.type){
                this.userinfo = res.result
                sessionStorage.setItem("roleid",res.result.roleid)
                sessionStorage.setItem("username",res.result.username)
            }
        })
    }
 
}
</script>

<style lang="scss" scoped>
    .el-header{
       background: cadetblue;
    }
    .el-footer{
        background: cadetblue;
    }
    .boxmain{
        width: 100%;
        height: 100%;
    }
    .el-aside{
        height: 100%;
        background: rgb(84,92,100);
    }
</style>